package com.miya.order.controller;

import com.miya.order.configure.rabbitmq.dead.DeadLetterDemoConfigure;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试控制器
 *
 * @author Caixiaowei
 * @date 2022/02/21
 */
@RestController
@RequestMapping("/test")
public class TestController {

	@Autowired
	private RabbitTemplate rabbitTemplate;

	@GetMapping("/send")
	public void send(String msg) {
		rabbitTemplate.convertAndSend(DeadLetterDemoConfigure.BUSINESS_EXCHANGE, "", msg);
	}
}
